import { createRouter, createWebHistory } from 'vue-router';
import LoginView from '../views/login/LoginView.vue';
import HomeView from '../views/HomeView.vue';

import GreenhouseView from '../views/greenhouse/GreenhouseView.vue';
import EquipmentView from '../views/greenhouse/EquipmentView.vue';

import CropView from '../views/crop/CropView.vue';

import EnvironmentView from '../views/data/EnvironmentView.vue';
import LogView from '../views/data/LogView.vue';
import AlertView from '../views/data/AlertView.vue';
import CropDataView from '../views/data/CropView.vue';

import ChatView from '../views/ai/ChatView.vue';
import ImageRecognitionView from '../views/ai/ImageRecognitionView.vue';

import UserView from '../views/user/UserView.vue';

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: HomeView
  },
  {
    path: '/login',
    name: 'Login',
    component: LoginView
  },
  {
    path: '/greenhouse',
    name: 'Greenhouse',
    component: GreenhouseView
  },
  {
    path: '/equipment',
    name: 'Equipment',
    component: EquipmentView
  },
  {
    path: '/crop',
    name: 'Crop',
    component: CropView
  },
  {
    path: '/environment',
    name: 'Environment',
    component: EnvironmentView
  },
  {
    path: '/log',
    name: 'Log',
    component: LogView
  },
  {
    path: '/alert',
    name: 'Alert',
    component: AlertView
  },
  {
    path: '/cropdata',
    name: 'CropData',
    component: CropDataView
  },
  {
    path: '/chat',
    name: 'Chat',
    component: ChatView
  },
  {
    path: '/image_recognition',
    name: 'ImageRecognition',
    component: ImageRecognitionView
  },
  {
    path: '/user',
    name: 'User',
    component: UserView
  }
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
});

export default router;